#### MAPPINGS DECLARATIONS ####
map --new-mode nor ctrl+t
map --mode nor --new-mode scroll s
map --mode nor --new-mode tab t --on-unknown end

#### NORMAL MODE ####

# Windows
map --mode nor c combine : launch --location=vsplit --cwd=current : pop_keyboard_mode
map --mode nor shift+c combine : launch --location=hsplit --cwd=current : pop_keyboard_mode
map --mode nor d close_window

map --mode nor l neighboring_window right
map --mode nor h neighboring_window left
map --mode nor k neighboring_window top
map --mode nor j neighboring_window bottom

map --mode nor shift+l move_window right
map --mode nor shift+h move_window left
map --mode nor shift+k move_window top
map --mode nor shift+j move_window bottom

map --mode nor < resize_window wider 10
# '>' won't work, so I have to map the shifted equivalent (note: dvorak keyboard)
map --mode nor shift+. resize_window narrower 10
map --mode nor plus resize_window taller 10
map --mode nor minus resize_window shorter 10

# Layouts
map --mode nor z toggle_layout stack

# Searching the scrollback
map --mode nor / launch --stdin-source=@screen_scrollback --stdin-add-formatting less +G -R 

# Exit normal mode
map --mode nor i pop_keyboard_mode

#### END NORMAL MODE ####

#### SCROLL MODE ####

# Scrolling two lines at a time
map --mode scroll k combine : scroll_line_up : scroll_line_up
map --mode scroll j combine : scroll_line_down : scroll_line_down

map --mode scroll shift+K scroll_page_up 
map --mode scroll shift+J scroll_page_down

map --mode scroll g scroll_home
map --mode scroll shift+g scroll_end

map --mode scroll - scroll_to_prompt -1
map --mode scroll 0x2b scroll_to_prompt 1

map --mode scroll esc pop_keyboard_mode
map --mode scroll i pop_keyboard_mode

#### END scrollUAL MODE ####

#### TAB MODE ####

map --mode tab c new_tab_with_cwd
map --mode tab d close_tab

map --mode tab l next_tab
map --mode tab h previous_tab
map --mode tab shift+t move_tab_forward
map --mode tab shift+h move_tab_backward

map --mode tab esc pop_keyboard_mode
map --mode tab i combine : pop_keyboard_mode : pop_keyboard_mode 
